# New ports collection makefile for: oxygen-fonts
# Date created:		2012-02-11
# Whom:		Olivier Duchateau <duchateau.olivier@gmail.com>
#
# $FreeBSD$
#

PORTNAME=	oxygen-fonts
PORTVERSION=	0.1
CATEGORIES=	x11-fonts
MASTER_SITES=	http://avignu.tuxfamily.org/FreeBSD/distfiles/

MAINTAINER=	duchateau.olivier@gmail.com
COMMENT=	Font family for KDE desktop

LICENSE=	OFL
LICENSE_NAME=	Open Font License
LICENSE_FILE=	${WRKSRC}/COPYING-OFL
LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

BUILD_DEPENDS=	mkfontdir:${PORTSDIR}/x11-fonts/mkfontdir \
	mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale
RUN_DEPENDS=	fc-cache:${PORTSDIR}/x11-fonts/fontconfig

USE_XORG=	x11

FONTNAME=	Oxygen
FONTDIR=	${PREFIX}/lib/X11/fonts/${FONTNAME}

PLIST_SUB=	FONTDIR="${FONTDIR:S|${PREFIX}||}" \
	FCCACHE="${FCCACHE}"

SUB_FILES=	pkg-message
PKGMESSAGE=	${WRKDIR}/pkg-message
SUB_LIST=	FONTDIR=${FONTDIR}

FCCACHE=	${LOCALBASE}/bin/fc-cache -f -v
MKFONTDIR_CMD=	${LOCALBASE}/bin/mkfontdir
MKFONTSCL_CMD=	${LOCALBASE}/bin/mkfontscale

do-build:
	@cd ${WRKSRC} && ${MKFONTSCL_CMD} ; ${MKFONTDIR_CMD}

do-install:
	@${MKDIR} ${FONTDIR}
	@cd ${WRKSRC} && \
		${INSTALL_DATA} fonts.dir fonts.scale *.otf *.ttf ${FONTDIR}

post-install:
	@${ECHO_MSG} "===> Running fc-cache"
	-${FCCACHE} ${FONTDIR}
	@${ECHO_MSG}
	@${CAT} ${PKGMESSAGE}
	@${ECHO_MSG}

.include <bsd.port.mk>
